package com.TP.www.po;

/**
 * @author 邱彦祥
 */
public class Order {
    /**
     * 订单id
     */
    private Integer id;
    /**
     * 用户名
     */
    private String name;
    /**
     * 店铺名
     */
    private String storeName;
    /**
     * 商品名
     */
    private String goodName;
    /**
     * 数量
     */
    private Integer nums;
    /**
     * 单价
     */
    private Double price;
    /**
     * 抵扣金额
     */
    private Double discount;
    /**
     * 总费用
     */
    private Double totalCost;
    /**
     * 订单状态
     */
    private Integer state;

    public Order() {
    }

    public Order(Integer id, String name, String storeName, String goodName, Integer nums, Double price, Double discount, Double totalCost, Integer state) {
        this.id = id;
        this.name = name;
        this.storeName = storeName;
        this.goodName = goodName;
        this.nums = nums;
        this.price = price;
        this.discount = discount;
        this.totalCost = totalCost;
        this.state = state;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    public Integer getNums() {
        return nums;
    }

    public void setNums(Integer nums) {
        this.nums = nums;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Double getTotalCost() {
        return totalCost;
    }

    public void setTotalCost(Double totalCost) {
        this.totalCost = totalCost;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Override
    public String toString() {
        if(state == -1){
            return  "店铺名:" + storeName +
                    "商品名: " + goodName  +
                    " 数量: " + nums +
                    " 单价: " + price + "元" +
                    " 优惠金额: " + discount + "元" +
                    " 总价: " + totalCost + "元" +
                    " 已下单!";
        }else if (state == 0){
            return  "店铺名:" + storeName +
                    "商品名: " + goodName  +
                    " 数量: " + nums +
                    " 单价: " + price + "元" +
                    " 优惠金额: " + discount + "元" +
                    " 总价: " + totalCost + "元" +
                    " 商家接单!";
        }else {
            return "店铺名:" + storeName +
                    "商品名: " + goodName  +
                    " 数量: " + nums +
                    " 单价: " + price + "元" +
                    " 优惠金额: " + discount + "元" +
                    " 总价: " + totalCost + "元" +
                    " 订单完成";
        }
    }
}
